package com.lhsy.djcloud.mapper;

import com.lhsy.djcloud.entity.Department;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wangzw
 * @since 2020-09-14
 */

public interface DepartmentMapper extends BaseMapper<Department> {

    /**
     * 加载所有的部门信息
     * @param tenantId
     * @param pid
     * @return
     */
    List<Department> getAllDepartmentsByParentId(@Param("tenantId") Integer tenantId, @Param("pid")Integer pid);

    String selectDeptNameById(Integer id);

    List<Department> getChildrenDept(@Param("tenantId")Integer tenantId,@Param("params")String params);
    Department selectByPk(Integer id);

    List<Department> getByLevel(@Param("tenantId")Integer tenantId,@Param("level") Integer level);

    List<Department> selectNoSelf(@Param("userId") Integer userId,@Param("tenantId") Integer tenantId);

    List<Department> selectTreeList(@Param("id") Integer id,@Param("tenantId") Integer tenantId);

}
